package com.zheng.damo1;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;

public class DateTest {
    public static void main(String[] args) {
        Date date1 = new Date(3534545L);
        Date date2 = new Date(6534545L);
        BigDecimal bd=new BigDecimal(date2.getTime()-date1.getTime()+"");
        BigDecimal time = bd.divide(new BigDecimal("1000"),3, RoundingMode.HALF_UP)
                .divide(new BigDecimal("3600"),3, RoundingMode.HALF_UP)
                .divide(new BigDecimal("24"),3, RoundingMode.HALF_UP);
        System.out.println(time+"天");
    }
}
